Get Assessment Tasks
Introduction
There are two API's for retrieving information about an Assessment Tasks:
- GET /api/v2/assessmenttask
- Gets a paginated list of assessment tasks. The optional parameter 'showAll' is available to get all assessment tasks regardless of task assignment, depending on the request user's permissions.
- Search filters, pagination, and ordering can be applied as per the articleSearch-Filters-and-Pagination
- GET /api/v2/assessmenttask/{id}
- Gets the full details of a specific assessment task
GET /api/v2/assessmenttask
The Assetic REST API GET /api/v2/assessmenttask endpoint returns a paginated list of Assessment Tasks.
Using the 'showAll' Parameter
By default, the response for the GET /api/v2/assessmenttask endpoint returns only assessment tasks assigned to the authenticated user performing the API request. To retrieve all Assessment Tasks assigned to any/all users, the 'showAll=true' flag can be used as a parameter for the request:
https://[yoursite].assetic.net/api/v2/assessmenttask?showAll=true
Please note that the 'showAll' request parameter is subject to user role permissions. The authenticated user performing the request requires a user role higher than 'Assessments Officer' (i.e 'Assessments Manager', 'Assessments Admin', or 'Client Admin'). Users with only the 'Assessments Officer' role are restricted to only viewing assessment tasks where they are assigned as a Resource.
Please see the User Roles & Permissions article for more information on how permissions are managed within Brightly Assetic.
Sample Payloads
The sample below illustrates a search for assessment tasks where the start date of the assessment is greater than the DateTime "2022-07-19T00:00:00". It returns 50 assessment tasks from the first page of the request's response. The parameter 'showAll' is set to 'false', and therefore the response will only contain results assigned to the authenticated user performing the request:
https://[yoursite].assetic.net/api/v2/assessmenttask?showAll=false&requestParams.filters=StartDate~gt~'2022-07-19T00%3A00%3A00'&requestParams.page=1&requestParams.pageSize=50
The following request uses the 'showAll=true' parameter to retrieve assessment tasks regardless of assessment task assignment, where the task's external ID is "EXT51242":
https://[yoursite].assetic.net/api/v2/assessmenttask?showAll=true&requestParams.filters=ExternalIdentifier~eq~'EXT51242'
The following request retrieves page 1 of the response with up to 500 assessment tasks, regardless of assignment, where the assessment task's 'Status' is 'Completed' (300=Open, 500=Completed):
https://[yoursite].assetic.net/api/v2/assessmenttask?showAll=true&requestParams.filters=Status~eq~'500'&requestParams.page=1&requestParams.pageSize=500
Sample Response
The following is a sample request and response filtering for a specific assessment task, where'TaskId' is equal to 'TASK015270'. As only one result is expected, the results are limited to the 1st page and the page size is set to 1. The parameter 'showAll' is set to 'true' to search for assessment tasks regardless of assignment.
Request
https://[yoursite].assetic.net/api/v2/assessmenttask?showAll=true&requestParams.filters=TaskId~eq~'TASK015270'&requestParams.page=1&requestParams.pageSize=1
Response
{ "TotalResults": 1, "TotalPages": 1, "Page": 1, "ResourceList": [ { "Id": "3108d1ad-515c-4b33-9b92-ca86ea982b09", "AsmtProjectId": "0b8f6217-ccff-4064-9f03-17f63851d29d", "Status": 300, "AssessmentLevel": 0, "RsResourceIdAssignedTo": { "Id": "54d94c87-5034-e711-946c-06edd62954d7", "DisplayName": "Roger Federer", "_links": [], "_embedded": null }, "Name": "Assess asset 61073", "TaskId": "TASK015270", "StartDate": "2023-01-01T00:00:00", "EndDate": "2023-01-31T00:00:00", "CompletionDate": null, "Priority": 0, "ResultsCount": 0, "Comments": "Comment 1", "LastModified": "2019-06-27T14:55:38", "CreatedDateTime": "2019-06-27T14:55:38", "ExternalIdentifier": "EXAMPLE12345", "AsmtTaskForms": [ { "FormId": "15d1ac04-b9f7-e511-9457-06edd62954d7", "FormName": "FORM0013", "FormLabel": "Defect Assessment", "Minimum": 1, "Maximum": 10, "Order": 1, "FormVersion": 0, "FormResultCount": 0 } ], "TaskTypeId": 1, "AssetObject": { "Id": "e764fed0-13a6-4292-85d5-a13ec2853b88", "Name": "61073", "Label": "Elmsleigh Road-01", "TypeLabel": "Asset", "Type": 0, "LocationWkt": "POINT (152.67302261668877 -26.191143342639823)" }, "_links": [], "_embedded": null } ], "_links": [], "_embedded": null }
GET /api/v2/assessmenttask/{id}
The Assetic REST API GET /api/v2/assessmenttask/{id} returns the assessment task details for a provided single Assessment Task, where {id} is the Assetic GUID for the assessment task. This API endpoint is typically used when the GUID has been recorded in an external application in order to retrieve the single task's details without the requirement of filtering.
Sample Payload
The sample below illustrates the GET using the GUID property for an individual Assessment Task:
https://[yoursite].assetic.net/api/v2/assessmenttask/3108d1ad-515c-4b33-9b92-ca86ea982b09
Sample Response
{ "Id": "3108d1ad-515c-4b33-9b92-ca86ea982b09", "AsmtProjectId": "0b8f6217-ccff-4064-9f03-17f63851d29d", "Status": 300, "AssessmentLevel": 0, "RsResourceIdAssignedTo": { "Id": "54d94c87-5034-e711-946c-06edd62954d7", "DisplayName": "Roger Federer", "_links": [], "_embedded": null }, "Name": "Assess asset 61073 - Elmsleigh Road-01", "TaskId": "TASK015270", "StartDate": "2023-01-01T00:00:00", "EndDate": "2023-01-31T00:00:00", "CompletionDate": null, "Priority": 0, "ResultsCount": 0, "Comments": "Comment 1", "LastModified": "2019-06-27T14:55:38", "CreatedDateTime": "2019-06-27T14:55:38", "ExternalIdentifier": "EXAMPLE12345", "AsmtTaskForms": [ { "FormId": "15d1ac04-b9f7-e511-9457-06edd62954d7", "FormName": "FORM0013", "FormLabel": "Defect Assessment", "Minimum": 1, "Maximum": 10, "Order": 1, "FormVersion": 1, "FormResultCount": 0 } ], "TaskTypeId": 1, "AssetObject": { "Id": "e764fed0-13a6-4292-85d5-a13ec2853b88", "Name": "61073", "Label": "Elmsleigh Road-01 (Lampton Avenue)", "TypeLabel": "Asset", "Type": 0, "LocationWkt": "POINT (152.67302261668877 -26.191143342639823)" }, "_links": [], "_embedded": null }